<template>
  <div>
    <h1>在子组件更改 Vuex 的 state，在父组件使用 watch 监听改 state, 在监听的回调函数中处理你的逻辑</h1>
    <hr>
    <a-select default-value="lucy" style="width: 120px" @change="handleChange">
      <a-select-option value="jack">
        Jack
      </a-select-option>
      <a-select-option value="lucy">
        Lucy
      </a-select-option>
      <a-select-option value="disabled" disabled>
        Disabled
      </a-select-option>
      <a-select-option value="Yiminghe">
        yiminghe
      </a-select-option>
    </a-select>
  </div>
</template>

<script>
export default {
  name: 'TestVuexWatch',
  methods: {
    handleChange (val) {
      this.$store.commit('setSelectData', val)
    }
  }
}
</script>

<style scoped>

</style>
